package com.mouse.hadoop.config;

import com.mouse.hadoop.explorer.service.HdfsService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @program: hadoop-samples
 * @description:
 * @author: Chenjiabin
 * @create: 2019/5/14 17:54
 **/
@Configuration
public class HdfsConfig {

    @Value("${hdfs.defaultFS}")
    private String defaultHdfsUri;

    @Bean
    public HdfsService getHbaseService() {

        org.apache.hadoop.conf.Configuration conf = new org.apache.hadoop.conf.Configuration();

        conf.set("fs.defaultFS", defaultHdfsUri);

        return new HdfsService(conf, defaultHdfsUri);
    }
}
